<aside class="lg-side">
  <div class="panel-heading tab-bg-dark-navy-blue okr-tab-head tab-right "></div>
  <div class="inbox-body mi-h8">
    <div class="row">
      <div class="col-lg-12">
        <section class="panel">
          <header class="panel-heading add-heading">
            项目公告信息
          </header>
          <div class="panel-body">
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">公告标题*</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="title" maxlength="50" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" placeholder="字数限制(50字以内)"></textarea>
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">公告内容*</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="content" maxlength="120" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" placeholder="字数限制(120字以内)"></textarea>
              </div>
            </div>
            <p class="default-buttons">
              <a href="javascript:void(0);" class="button-back btn btn-info" onclick="toBack()">返回</a>
              <a href="javascript:void(0);" class="button-next  btn btn-info submit">提交</a>
            </p>
          </div>
        </section>
        
      </div>
    </div>
  </div>
</aside>
<script>
  function toBack() {
    toLoadHtml(50);
  }
  $(".submit").on('click', function () {
    var title = $("#title").val();
    if (title == "" || title == null || title == undefined) {
      layer.msg("公告标题不能为空！");
      return;
    }
    var content = $("#content").val();
    if (content == "" || content == null || content == undefined) {
      layer.msg("公告内容不能为空！");
      return;
    }
    var index = layer.load(1);
    $certusUtils.ajax("toAddNotice", {
      "projId": proId,
      "title": title,
      "content": content
    }, function (response) {
        layer.close(index);
      layer.msg("添加成功");
      toLoadHtml(50);
    })
  })
</script>